import VConsole from 'vconsole';

let vConsole: VConsole | null = null;

export function initVConsole() {
  const urlParams = new URLSearchParams(window.location.search);
  const debug = urlParams.get('debug');
  
  if (debug === '1' && !vConsole) {
    vConsole = new VConsole({
      theme: 'dark',
      log: {
        maxLogNumber: 1000,
        showTimestamps: true
      }
    });
    console.log('vConsole initialized');
  }
}

export function destroyVConsole() {
  if (vConsole) {
    vConsole.destroy();
    vConsole = null;
  }
}